package net.pinnoocle.playweb.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.pinnoocle.playcommon.response.BaseResult;
import net.pinnoocle.playdao.entity.page.PageModel;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListPageVo;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListSearchParams;
import net.pinnoocle.playdao.entity.shopPc.room.RoomListVo;
import net.pinnoocle.playservice.service.impl.RoomServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ye
 * @Description
 * @create 2021-11-05 18:16
 */

@RestController
@RequestMapping("/room")
@Api(tags = "房间相关")
public class RoomController {

    @Autowired
    RoomServiceImpl roomService;

    @GetMapping("roomListWithPage")
    @ApiOperation("房间列表---分页")
    public BaseResult<PageModel<RoomListPageVo>> roomListWithPage(RoomListSearchParams searchParams){
        return new BaseResult<PageModel<RoomListPageVo>>().ok(roomService.roomListWithPage(searchParams));
    }

    @GetMapping("roomList")
    @ApiOperation("获取空闲房间---无分页")
    public BaseResult<List<RoomListPageVo>> roomList(){
        return new BaseResult<List<RoomListPageVo>>().ok(roomService.roomList());
    }
}
